﻿// Copyright © Microsoft Corporation.  All Rights Reserved.
// This code released under the terms of the 
// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)

namespace Microsoft.Expression.Prototyping.Mockups
{
	using System;
	using System.Globalization;
	using System.Windows;
	using System.Windows.Data;

	public class BoolToVisibilityCollapsedConverter : IValueConverter
	{
		public BoolToVisibilityCollapsedConverter()
		{
		}

		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			Boolean? booleanValue = value as Boolean?;

			if (booleanValue.HasValue)
			{
				return ((booleanValue.Value == true) ? Visibility.Visible : Visibility.Collapsed);
			}

			return Visibility.Collapsed;
		}

		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
			throw new NotImplementedException();
		}
	}
}